package com.onenine.app.activity;

import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;

import com.onenine.app.R;
import com.onenine.app.utils.DataType;
import com.onenine.base.base.BaseActivity;

/**
 * 创建时间：2018/6/23 0023 16:14
 * 创建人：fly
 * 功能描述：单聊选项
 */
public class PrivateOptionActivity extends BaseActivity implements View.OnClickListener {

    private TextView mTvName, mTvComplain;
    private String mTargetId;

    public static void launchActivity(Context context, String targetId, String targetName) {
        Intent intent = new Intent(context, PrivateOptionActivity.class);
        intent.putExtra("targetId", targetId);
        intent.putExtra("targetName", targetName);
        context.startActivity(intent);
    }

    @Override
    protected void initViews() {
        super.initViews();
        mToolbar.setCenterTitle(R.string.chat_info);
        mTvName = findViewById(R.id.tv_name);
        mTvComplain = findViewById(R.id.tv_complain_user);
    }

    @Override
    protected void initListeners() {
        mTvComplain.setOnClickListener(this);
    }

    @Override
    protected void initData() {
        super.initData();
        mTargetId = getIntent().getStringExtra("targetId");
        mTvName.setText(getIntent().getStringExtra("targetName"));
        if (TextUtils.isEmpty(mTargetId)) {
            finish();
        }
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_private_option;
    }

    @Override
    public void onClick(View v) {
        if (v.getId() == R.id.tv_complain_user) {
            ReportOptionActivity.launchActivity(this
                    , DataType.REPORT_USER, mTargetId);
        }
    }

}
